/*
 * @CreateTime: Dec 1, 2017 10:11 AM
 * @Author: Conroy
 * @Contact: jianwen.liu@sunlight-tech.com
 * @Last Modified By: Conroy
 * @Last Modified Time: Dec 1, 2017 10:14 AM
 * @Description: Modify Here, Please 
 */


export const Fetch = (url, options) => {
  return new Promise((resolve, reject) => {
    fetch(url, options)
      .then(async (res) => {
        let data = {
          status: res.status,
          ok: res.ok,
          statusText: res.statusText,
          data: await res.json(),
        }
        resolve(data);
      })
      .catch(err => {
        reject(err);
      })
  })
}
